// more complicated vert shader - phongModel.vert
#version 150
// OpenGL3.2

// uniform mat4 MVP; //dont need this.
uniform mat4 MVM;
uniform mat4 PROJ;
uniform vec4 lightPosition;
uniform float ID;



in vec3 in_position; 	// vert position
in vec3 in_normal;		// vertex normal
in vec2 in_texcoord;		// texture coord;

out vec3 exN;
out vec3 exV;
out vec3 exL;
out vec2 exTexCd;
out vec4 ID_color;

void main(void){
	
	// Vertex into eye coords						//uncomment for lolz
	vec4 vertexPos = MVM * (vec4(in_position,1.0));
	// Find V, in eye coords, eye is at 0.
	exV = normalize(-vertexPos.xyz);
	// Vertex normal in eye coordinates
	exN = normalize(MVM * vec4(in_normal,0.0)).xyz;
	// L - to light from vert.
	exL = normalize(lightPosition.xyz - vertexPos.xyz);
	
	exTexCd =  in_texcoord;
	
	gl_Position = PROJ * vertexPos;

	ID_color = vec4(vec3(ID), 1.0);
}